﻿<Core:DXWindow x:Class="ThanNhanTao.frmThanhToanNoiTru"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:Core="clr-namespace:DevExpress.Xpf.Core;assembly=DevExpress.Xpf.Core.v11.1"
        xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"
        dxc:ThemeManager.ThemeName="Office2007Blue" Icon="/ThanNhanTao;component/Images/iconbv48x48.ico"
        Title="Phiếu thanh toán nội trú" Height="550" Width="780" WindowState="Maximized">
    <Core:DXWindow.Resources>
        <Style TargetType="Label">
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
        <Style TargetType="dxe:DateEdit">
            <Setter Property="Margin" Value="2,2" />
        </Style>
    </Core:DXWindow.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"></RowDefinition>
            <RowDefinition Height="28"></RowDefinition>
            <RowDefinition Height="200*"></RowDefinition>
            <RowDefinition Height="40"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="60"></ColumnDefinition>
            <ColumnDefinition Width="130"></ColumnDefinition>
            <ColumnDefinition Width="8"></ColumnDefinition>
            <ColumnDefinition Width="60"></ColumnDefinition>
            <ColumnDefinition Width="130"></ColumnDefinition>
            <ColumnDefinition Width="8"></ColumnDefinition>
            <ColumnDefinition Width="100"></ColumnDefinition>
            <ColumnDefinition Width="130"></ColumnDefinition>
            <ColumnDefinition Width="20*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <!--<Label HorizontalAlignment="Center" Content="PHIẾU THANH TOÁN NGOẠI TRÚ" FontSize="16" FontWeight="Bold" Foreground="Coral"
               Grid.ColumnSpan="4"></Label>-->
        <Label Name="lblThongTinBN" FontWeight="Bold" Foreground="Blue" Grid.ColumnSpan="3"  FontSize="13"></Label>
        <Label Name="lblTuNgay" Grid.Row="1" Content="Từ ngày:"></Label>
        <dxe:DateEdit Grid.Column="1" Grid.Row="1" Name="deTuNgay" 
                      Mask="dd/MM/yyyy" MaskAutoComplete="Optimistic" MaskType="DateTimeAdvancingCaret" DisplayFormatString="dd/MM/yyyy"
                      Validate="deTuNgay_Validate"
                      EditValueChanging="deTuNgay_EditValueChanging" />
        <Label Name="lblDenNgay" Grid.Row="1" Content="Đến ngày:" Grid.Column="3"></Label>
        <dxe:DateEdit Grid.Column="4" Grid.Row="1" Name="deDenNgay" 
                      Mask="dd/MM/yyyy" MaskAutoComplete="Optimistic" MaskType="DateTimeAdvancingCaret" DisplayFormatString="dd/MM/yyyy"
                      Validate="deDenNgay_Validate"
                      EditValueChanging="deDenNgay_EditValueChanging" />
        <Label Name="lblNgayThanhToan" Foreground="Red" Grid.Row="1" Grid.Column="6" Content="Ngày yêu cầu:"></Label>
        <dxe:DateEdit Grid.Column="7" Grid.Row="1" Name="deNgayThanhToan" 
                      Mask="dd/MM/yyyy" MaskAutoComplete="Optimistic" MaskType="DateTimeAdvancingCaret" DisplayFormatString="dd/MM/yyyy"
                      Validate="deNgayThanhToan_Validate"/>
        <dxg:GridControl Name="gridChiDinh" Grid.Row="2" Grid.ColumnSpan="9" AutoExpandAllGroups="True" >
            <dxg:GridControl.Columns>
                <dxg:GridColumn FieldName="TenLoaiYeuCau" ReadOnly="True" Header="" GroupIndex="0" />
                <dxg:GridColumn FieldName="MaYeuCau" Header="Mã yêu cầu" Width="40" Name="colMaYeuCau" />
                <dxg:GridColumn FieldName="TenYeuCau" Header="Tên yêu cầu" ReadOnly="True" />
                <dxg:GridColumn FieldName="TenDonViTinh" Header="Đơn vị" Width="40" ReadOnly="True"/>
                <dxg:GridColumn FieldName="SoLuong" Header="Số lượng" Width="40" Name="colSoluong" Validate="colSoluong_Validate">
                    <dxg:GridColumn.EditSettings>
                        <dxe:TextEditSettings MaskType="Numeric"/>
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
                <dxg:GridColumn FieldName="GiaYeuCau" Header="Đơn giá" Width="50" ReadOnly="True">
                    <dxg:GridColumn.EditSettings>
                        <dxe:TextEditSettings MaskType="Numeric" Mask="c0" MaskUseAsDisplayFormat="True" MaskCulture="Vietnamese (Vietnam)"/>
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
                <dxg:GridColumn FieldName="ThanhTien" Header="Thành tiền" UnboundType="Decimal" ReadOnly="True" 
                                UnboundExpression="[GiaYeuCau] * [SoLuong]" Width="50" Name="colThanhTien">
                    <dxg:GridColumn.EditSettings>
                        <dxe:TextEditSettings MaskType="Numeric" Mask="c0" MaskUseAsDisplayFormat="True" MaskCulture="Vietnamese (Vietnam)"/>
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
            </dxg:GridControl.Columns>
            <dxg:GridControl.View>
                <dxg:TableView Name="tbvChiDinh" ShowGroupPanel="False" AutoWidth="True" NewItemRowPosition="Top" AllowGrouping="True"
                               PreviewKeyDown="tbvChiDinh_PreviewKeyDown" FocusedRowChanged="tbvChiDinh_FocusedRowChanged"
                               ValidateRow="tbvChiDinh_ValidateRow" InvalidRowException="tbvChiDinh_InvalidRowException" />
            </dxg:GridControl.View>
        </dxg:GridControl>
        <Grid Background="#FFC9E8F6" Grid.Row="3" Grid.ColumnSpan="9">
            <Grid.RowDefinitions>
                <RowDefinition Height="4" />
                <RowDefinition Height="30" />
                <RowDefinition Height="4" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="3" />
                <ColumnDefinition Width="75" />
                <ColumnDefinition Width="281*" />
                <ColumnDefinition Width="75" />
                <ColumnDefinition Width="8" />
                <ColumnDefinition Width="75" />
                <ColumnDefinition Width="8" />
                <ColumnDefinition Width="75" />
                <ColumnDefinition Width="8" />
                <ColumnDefinition Width="75" />
                <ColumnDefinition Width="3" />
            </Grid.ColumnDefinitions>
            <Button Name="btnLuu" Click="btnLuu_Click" Content="_Lưu" Grid.Column="3" Grid.Row="1" IsEnabled="False" />
            <Button Name="btninPhieu" Click="btninPhieu_Click" Content="_In phiếu" Grid.Column="1" Grid.Row="1"/>
            <Button Name="btnDong" Click="btnDong_Click" Content="Đó_ng" Grid.Column="9" Grid.Row="1"/>
            <Button Name="btnXoa" Click="btnXoa_Click" Content="_Xóa" Grid.Column="7" Grid.Row="1" IsEnabled="False"/>
            <Button Name="btnHuyBo" Click="btnHuyBo_Click" Grid.Row="1" Content="_Hủy bỏ" Grid.Column="5" IsEnabled="False"></Button>
        </Grid>
        
    </Grid>
</Core:DXWindow>
